<?php

/**
 * QuestionChannel form base class.
 *
 * @method QuestionChannel getObject() Returns the current form's model object
 *
 * @package    iEasy
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseQuestionChannelForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'           => new sfWidgetFormInputHidden(),
      'title'        => new sfWidgetFormTextarea(),
      'notes'        => new sfWidgetFormTextarea(),
      'create_time'  => new sfWidgetFormDateTime(),
      'update_time'  => new sfWidgetFormDateTime(),
      'is_on_top'    => new sfWidgetFormInputCheckbox(),
      'is_available' => new sfWidgetFormInputCheckbox(),
      'img'          => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'id'           => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'title'        => new sfValidatorString(array('max_length' => 500, 'required' => false)),
      'notes'        => new sfValidatorString(array('max_length' => 1000, 'required' => false)),
      'create_time'  => new sfValidatorDateTime(array('required' => false)),
      'update_time'  => new sfValidatorDateTime(array('required' => false)),
      'is_on_top'    => new sfValidatorBoolean(array('required' => false)),
      'is_available' => new sfValidatorBoolean(array('required' => false)),
      'img'          => new sfValidatorString(array('max_length' => 1000, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('question_channel[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'QuestionChannel';
  }

}
